<?php
namespace app\admin\controller;

use think\Request;
use think\Controller;


class Index extends controller
{
	 public function _empty($methodParams)
    {
    	if(!empty($methodParams) && $methodParams=="login"){
    			//登陆页面的逻辑处理
    			return $this->fetch('login');
    	}
    	elseif(!empty($methodParams) && $methodParams=="index"){
    		    //后台首页的逻辑处理
    		    return $this->fetch('index');
    	}
    	else{
    		 return $this->errorMessage();
    	}    
    }

    protected function errorMessage(){
    	return '您的操作有误，请重试!';
    }

    public function ceshi(){
    	$url = "https://open.ucpaas.com/ol/sms/sendsms";
    	$param =[
    			"sid" =>"39467b989d087c2d92c6132184a365d8",
    			"token" =>"23f757bad208226ec301e117e40006ed",
    			"appid" =>"2d92c6132139467b989d087c84a365d8",
    			"templateid" =>"154501",
    			"param"=>"87828,3",
    			"mobile"=>"13640842984",
    			"uid"=>"2d92c6132139467b989d087c84a365d8"
    	];
    	$postUrl = $url;
        $curlPost = $param;
        $ch = curl_init();//初始化curl
        curl_setopt($ch, CURLOPT_URL,$postUrl);//抓取指定网页
        curl_setopt($ch, CURLOPT_HEADER, 0);//设置header
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);//要求结果为字符串且输出到屏幕上
        curl_setopt($ch, CURLOPT_POST, 1);//post提交方式
        curl_setopt($ch, CURLOPT_POSTFIELDS, $curlPost);
        $data = curl_exec($ch);//运行curl
        curl_close($ch);
        var_dump($ch);
        //return $data;
    }
    
}
